package top.lyunk.demo.kafka;


public class ProducerMain {
    public static void main(String[] args) throws InterruptedException {
        Producer producer = new CommonProducer();
        for (int i = 0; i < 1000; i++) {
            String topic = "lyunk-common-topic";
            String value = "lyunk-common-value-" + i;
            System.out.println("send message: " + value);
            producer.send(topic, "1", value);
            Thread.sleep(1 * 1000);
        }
        producer.close();
        Thread.sleep(1000 * 1000);
    }
}
